
# 广播机制

import torch

a = torch.arange(3).reshape(3, 1)
b = torch.arange(2).reshape(1, 2)

print(a + b)